<?php
/**
 * Created by PhpStorm.
 * User: @answer
 * Date: 17-4-27
 * Time: 上午11:42
 * version: 1.0
 */

namespace Admin\Model;
use Think\Model;

class UserModel extends Model{

    public function fPage($pageSize = 1){
        $count = $this->count();
        $page = new \Think\Page($count,$pageSize);
        $page->setConfig('prev','上一页');
        $page->setConfig('next','下一页');

        $data['page'] = $page->show();
        $data['data'] = $this->limit($page->firstRow.','.$page->listRows)->select();

        return $data;
    }

    public function _before_insert(){
        $data['create_at'] = time();
    }

} 